<?php 
$sql = "SELECT * FROM #__header WHERE id=2";
$database->setQuery($sql);
$database->loadObject($footer);
echo $footer->content;
?>